# def outer(logo):
#     def inner(msg):
#         print(f"<{logo}> {msg} <{logo}>")
#
#     return inner
#
# inner1 = outer("*")
# inner1("hello")


# def outer(num1):
#     def inner(num2):
#         nonlocal num1
#         num1 += num2
#         print(num1)
#     return inner
#
# inner1 = outer(10)
# inner1(20)
# inner1(20)


def account_create(inittial_balance=0):
    def atm(balance, deposit=True):
        nonlocal inittial_balance
        if deposit:
            inittial_balance += balance
            print(f"{inittial_balance}")
        else:
            inittial_balance -= balance
            print(f"{inittial_balance}")

    return atm

account = account_create()
account(100)
account(100)
account(100, False)
